/*
 SGSortingGameViewController.h
 Date Created: Feburary 24, 2010
 
 Authors: Karanvir Gill <viper1029@gmail.com>
				 Frank Lau <flaua@sfu.ca>
 
 Copyright (C) 2010 Green-Power
 
 URL: http://code.google.com/p/green-power
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 $Id$
 */

#import <UIKit/UIKit.h>
#import "SGRecyclableItem.h"
#import "SGSortingGameLevel.h"

@interface SGSortingGameViewController : UIViewController {
	IBOutlet UILabel *scoreLabel;
	
	NSUInteger score;
	NSUInteger numberOfItemsAlreadyDisplayed;
	NSUInteger totalNumberOfItemsToDisplay;
	
	NSMutableArray *arrayOfItemsToDisplay;
	NSMutableArray *itemsOnScreen;
	NSMutableArray *binsOnScreen;
	
	CGPoint speedOfItems;
	SGSortingGameLevel *sortingGameLevel;
  
  NSTimer *moveTimer; // Move items across the screen
  NSTimer *createTimer; // Create new items
	
}

@property (nonatomic, retain) SGSortingGameLevel *sortingGameLevel;
@property (nonatomic,retain) IBOutlet UILabel *scoreLabel;

/**
 * Pauses the game and shows the SGPauseViewController
 */
- (IBAction)pauseGame:(id)sender;

/**
 * Creates a recyclable item and shows it on display. It will only create items 
 * if numberOfItemsAlreadyDisplayed is less than totalNumberOfItemsToDisplay.
 * The recyclable type to create is determined by arrayOfItemsToDisplay.
 */
- (void)createItem;

/**
 * Moves all the objects on the screen down by a certain number of pixels 
 * (determined by the level). Checks if the objects are over a bin, in the
 * garbage or anywhere else on the screen. If an item have been picked up 
 * then it will disapper when dropped, and points will only be given if its 
 * dropped in the correct bin.
 */
- (void)moveItems;

/**
 * Used to place the bins on the screen. Adds the created bins to the
 * binsOnScreen array.
 */
- (void)drawBins;


@end